import database, config, uwsgi
import cgi

def doModel(env, output):
	
	
	form = cgi.parse(fp=env["wsgi.input"], environ=env)
	print form
	db = database.db(config.hostdb, config.portdb, config.namedb, 
		config.userdb, config.passdb)
	title = form["title_input"][0]
	text = form["text"][0]
	output.addBody('tpl_title', db.postText(title, text))
